﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddTransporter.aspx.cs" Inherits="ForestryEnterprise.AddTransporter" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            width: 126px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <h2>Add Transporter</h2>
    <div>
    
        <table class="style1">
            <tr>
                <td class="style2">
                    <asp:Label ID="Label1" runat="server" Text="Transporter Name:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="TranName" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label2" runat="server" Text="Transporter Price:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="TranPrice" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label3" runat="server" Text="Zip:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="Zip" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label4" runat="server" Text="City:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="City" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label5" runat="server" Text="State:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="State" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label6" runat="server" Text="Street name"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="Strname" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:Label ID="Label7" runat="server" Text="Street number:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="Strnumber" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    <asp:Button ID="AddTrans" runat="server" onclick="Button1_Click" 
                        Text="Add new" />
                </td>
                <td>
                    <asp:Label ID="err" runat="server"></asp:Label>
                </td>
            </tr>
            </table>
        <br />
&nbsp;
        <asp:GridView ID="TransDataView" runat="server" AllowSorting="True" 
            AutoGenerateColumns="False" DataKeyNames="t_id" DataSourceID="TransData" 
            EnableModelValidation="True" 
            onselectedindexchanged="TransDataView_SelectedIndexChanged">
            <Columns>
                <asp:CommandField HeaderText="Update" SelectText="update" 
                    ShowSelectButton="True" />
                <asp:BoundField DataField="t_id" HeaderText="Transporter Id" InsertVisible="False" 
                    ReadOnly="True" SortExpression="t_id" />
                <asp:BoundField DataField="t_name" HeaderText="Transporter name" 
                    SortExpression="t_name" />
                <asp:BoundField DataField="t_price" HeaderText="Transporter price" 
                    SortExpression="t_price" />
                <asp:BoundField DataField="a_zip" HeaderText="Zip" SortExpression="a_zip" />
                <asp:BoundField DataField="a_city" HeaderText="City" 
                    SortExpression="a_city" />
                <asp:BoundField DataField="a_state" HeaderText="State" 
                    SortExpression="a_state" />
                <asp:BoundField DataField="a_strname" HeaderText="Street name" 
                    SortExpression="a_strname" />
                <asp:BoundField DataField="a_strnumb" HeaderText="Street number" 
                    SortExpression="a_strnumb" />
            </Columns>
        </asp:GridView>
        <asp:AccessDataSource ID="TransData" runat="server" 
            DataFile="~/App_Data/ForestryEnterprise.mdb" 
            SelectCommand="SELECT * FROM [Transporter]"></asp:AccessDataSource>
&nbsp;<br />
&nbsp;</div>
<div id="updateItem" runat="server" visible="false">
            <hr />
            <asp:TextBox ID="updateName" runat="server" />
            <asp:TextBox ID="updatePrice" runat="server" />
            <asp:TextBox ID="updateZip" runat="server" />
            <asp:TextBox ID="updateCity" runat="server"></asp:TextBox>
            <asp:TextBox ID="updateState" runat="server"></asp:TextBox>
            <asp:TextBox ID="updateStreetname" runat="server"></asp:TextBox>
            <asp:TextBox ID="updateStreetnumber" runat="server"></asp:TextBox>
            <asp:Button ID="update" Text="Update" runat="server" onclick="update_Click" />
            <asp:Button ID="cancel" Text="Cancel" runat="server" onclick="cancel_Click" />
        </div>
    </form>
</body>
</html>
